package com.thkj.service.impl;

import com.thkj.framework.base.BaseService;

import com.thkj.business.examine.service.impl.TblCheckService;
import com.thkj.service.TblReformService;
import com.thkj.business.examine.entity.TblCheck;
import com.thkj.entity.TblReform;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TblReformServiceImpl extends BaseService implements TblReformService {
	
	@Autowired
	TblCheckService tblCheckService;
	@Transactional
    public void insertTblReform(TblReform t){
        dao.insert("com.thkj.mapper.TblReform.insert", t);
        TblCheck tblCheck = new TblCheck();
        tblCheck.setId(t.getCheckId());
        tblCheck.setResult("-1");
        tblCheckService.updateResult(tblCheck);
    }

    public int updateTblReform(TblReform t){
        int row = dao.update("com.thkj.mapper.TblReform.update", t);
        return row;
    }

    public int deleteTblReform(String t ){
        return dao.delete("com.thkj.mapper.TblReform.delete", t);
    }

    public TblReform getTblReformById(String t){
        return dao.queryForObject("com.thkj.mapper.TblReform.getById", t, TblReform.class);
    }

	@Override
	public List<Map> query(String t) {
		return dao.queryForList("com.thkj.mapper.TblReform.query", t, Map.class);
	}

}